{extend name="public/base"}
{block name='main'}
<style type="text/css">
    .red {color: #FF5722!important;}
    .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="">
    <input type="hidden" name="menuid" value="67" />
    <div class="my-btn-box"> <span class="fl">
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">所属栏目</label>
        <div class="layui-input-inline">
          <select name="cid">
            <option value=""></option>
                {volist name="catelist" id="val" }
                       <option value="{$val.id}" {eq name="$searchArr.cid|default=''" value="$val.id"}selected="selected"{/eq}>{$val.name}</option>
                        {volist name="val['erji']" id="vo"}
                           <option value="{$vo.id}" {eq name="$searchArr.cid|default=''" value="$vo.id"}selected="selected"{/eq}>&nbsp;&nbsp;&nbsp;├─ {$vo.name}</option>
                        {/volist}
                    {/volist}
          </select>
        </div>
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline" style="width:100px">
          <select name="status" lay-filter="status" >
              <option value="" selected="selected">所有</option>
              <option value="1" {eq name="$searchArr.status|default=''" value="1"}selected="selected"{/eq}>已审核</option>
              <option value="0" {eq name="$searchArr.status|default='0'" value="0"}selected="selected"{/eq}>未审核</option>
          </select>
        </div>
        <label class="layui-form-label">关键词</label>
        <div class="layui-input-inline">
          <input type="tel" name="title" placeholder="文档关键词" lay-verify="required|phone" value="{$searchArr.title|default=''}" class="layui-input">
        </div>
        <div class="layui-input-inline">
          <button class="layui-btn mgl-20">搜索</button>
        </div>
      </div>
    </div>
    </span>
        <span class="fr">
        <a href="{:url('doc_con/index', array('menuid'=>1))}" class="layui-btn mgl-20">显示全部</a>
        <a class="layui-btn layui-btn-danger" id="btn-alldel">批量删除</a>
            <a class="layui-btn layui-btn-normal" id="btn-add">添加文档</a>
        </span> </div>
</form>
<form class="layui-form layui-form-pane" action="">
    <table class="layui-table">
        <colgroup>
            <col width="60">
            <col width="50">
            <col width="">
            <col width="120">
            <col width="120">
            <col width="120">
            <col width="80">
            <col width="150">
            <col width="100">
            <col width="80">
            <col width="100">
        </colgroup>
        <thead>
        <tr>
            <th><input type="checkbox" id="checkall_t" lay-skin="primary" lay-filter="allChoose" ></th>
            <th>ID</th>
            <th>文档标题</th>
            <th>所属专辑</th>
            <th>所属栏目</th>
            <th>作者</th>
            <th>所需积分</th>
            <th>上传时间</th>
            <th>状态</th>
            <th>是否转换</th>
            <th>管理操作</th>
        </tr>
        </thead>
        <tbody id="userList">
        {volist name="list" id="val" }
            <tr>
                <td><input class="doc_checkbox" type="checkbox" value="{$val.id}" lay-skin="primary" lay-filter="itemChoose"></td>
                <td>{$val.id}</td>
                <td><a href="{:url('home/doc/doccon',array('id'=>$val['id']))}" target="_blank">{$val.title}</a></td>
                <td>{$zjlist[$val['zjid']]|default='无'}</td>
                <td>{$cate_list[$val['cid']]}</td>
                <td>{$val['uid']|getusername}</td>
                <td>{$val.score}</td>
                <td>{$val.create_time|date='Y-m-d H:i'}</td>
                <td>
                    <input type="checkbox" name="status" value="{$val.status}" data-uri="{:url('doc_con/ajax_edit',['id'=>$val.id,'field'=>'status'])}" lay-skin="switch" lay-filter="status" lay-text="审核|未审"   {if ($val.status == 1)}checked{/if}>
                </td>
                <td>
                    {$val.convert_status_text}
                </td>

                <td>
                    <a href="javascript:;" class="J_showdialog" data-uri="{:url('doc_con/edit', array('id'=>$val['id']))}" data-title="编辑 - {$val.title}"  data-id="edit" data-acttype="ajax" id="edit">编辑</a> |
                    <a href="javascript:void(0);" class="J_confirmurl" data-acttype="ajax" data-uri="{:url('doc_con/delete', array('id'=>$val['id']))}" id="delete" data-msg="{:sprintf('确认要删除',$val['title'])}">删除</a>
                </td>
            </tr>
        {/volist}

        </tbody>
    </table>
</form>
<div id="test-laypage-demo0">
    <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-29">
        {$list|raw}
    </div>
</div>

<script>
    layui.use(['layer','jquery','form','element','table'], function () {

        //编辑弹窗
        Oper.config.edit.height = '300px';
        Oper.config.edit.height = '520px';

        //参数：layui、名称、模块名、主键（删除用）
        Oper.initList(layui, '文档', 'doc_con', 'id');

    });
</script>

{/block}